package net.entelijan.cobean.table;

import javax.swing.table.DefaultTableColumnModel;
import javax.swing.table.TableColumn;

/**
 * TODO Check if this workaround class is still necessary.
 * 
 * Sometimes swt requires a table column that does not exist
 * 
 */
final class SwtWorkaroundTableColumnModel extends DefaultTableColumnModel {

	private static final long serialVersionUID = 1L;
	private TableColumn tableColumn = new TableColumn();

	@Override
	public TableColumn getColumn(int columnIndex) {
		TableColumn re;
		if (this.tableColumns.size() > columnIndex) {
			re = super.getColumn(columnIndex);
		} else {
			re = this.tableColumn;
		}
		return re;
	}

}